package com.treasure.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author sunhongmin
 * @date 2023/10/21 10:01
 * @description 初始化-INIT_TRAINING、训练进行中-IN_TRAINING、训练成功-SUCCESS_TRAINING 、训练失败-FAIL_TRAINING
 */
@Getter
public enum TrainingStatEnum {
    INIT_TRAINING("INIT_TRAINING"),
    IN_TRAINING("IN_TRAINING"),
    SUCCESS_TRAINING("SUCCESS_TRAINING"),
    FAIL_TRAINING("FAIL_TRAINING"),
    ;
    private final String value;

    TrainingStatEnum(String value) {
        this.value = value;
    }

    public static TrainingStatEnum getInstance(String value){
        for (TrainingStatEnum trainingStatEnum : TrainingStatEnum.values()) {
            if(Objects.equals(trainingStatEnum.getValue(),value)){
                return trainingStatEnum;
            }
        }

        return null;
    }
}
